﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CityAdd.aspx.cs" Inherits="Omabar.CMS.CMS.CityAdd" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <link rel="stylesheet" type="text/css" href="../CSS/bootstrap_min.css" media="all" />
    <link rel="stylesheet" type="text/css" href="../CSS/bootstrap_responsive_min.css" media="all" />
    <link rel="stylesheet" type="text/css" href="../CSS/Style.css" media="all" />
    <link rel="stylesheet" type="text/css" href="../CSS/todc_bootstrap.css" media="all" />
    <link rel="stylesheet" type="text/css" href="../CSS/Themes.css" media="all" />
    <link rel="stylesheet" type="text/css" href="../CSS/inside.css" media="all" />
    <script type="text/javascript" src="../JavaScript/jquery.1.8.3.js"></script>
    <script type="text/javascript" src="../JavaScript/jquery.cookie.js"></script>
    <script type="text/javascript" src="../JavaScript/bootstrap.js"></script>
    <script type="text/javascript" src="../JavaScript/jquery_validate_min.js"></script>
    <script type="text/javascript" src="../JavaScript/jquery_validate_methods.js"></script>
    <script type="text/javascript" src="../JavaScript/jquery_form_min.js"></script>
    <script type="text/javascript" src="../JavaScript/inside.js"></script>
    <title></title>
    <link rel="shortcut icon" href="../favicon.ico" />
    <!--[if IE 7]><link href="../CSS/font_awesome_ie7.css" rel="stylesheet" /><![endif]-->
    <!--[if lte IE 9]><script src="../JavaScript/watermark.js"></script><![endif]-->
</head>
<body>
    <div id="main">
        <div class="container-fluid">
            <div class="row-fluid">
                <div class="span12">
                    <div class="box">
                        <div class="box-title">
                            <div class="span10">
                                <h3><i class="icon-edit"></i>请填写城市信息</h3>
                            </div>
                            <div class="span2"><a class="btn" href="Javascript:window.history.go(-1)">返回</a></div>
                        </div>

                        <div class="box-content">
                            <form action="../Handler/CityAdd.ashx" method="post" class="form-horizontal form-validate">
                                <div class="control-group">
                                    <label for="CITY_NAME" class="control-label">城市名称：</label>
                                    <div class="controls">
                                        <input type="text" name="CITY_NAME" id="CITY_NAME" class="input-medium" data-rule-required="true"/><span class="maroon">*</span>
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label">所属大洲：</label>
                                    <div class="controls">
                                        <select id="belong_Continent" class="input-medium" data-rule-required="true">
                                            <option value="亚洲">亚洲</option>
                                            <option value="欧洲">欧洲</option>
                                            <option value="北美洲">北美洲</option>
                                            <option value="南美洲">南美洲</option>
                                            <option value="大洋洲">大洋洲</option>
                                            <option value="非洲">非洲</option>
                                        </select><span class="maroon">*</span><span class="help-inline">
                                            <img id="busyIndicator" style="display:none;" src="../Images/loading.gif" />
                                        </span>
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label for="BELONG" class="control-label">所属国家：</label>
                                    <div class="controls">
                                        <select name="BELONG" id="country_Belong" class="input-medium" data-rule-required="true">
                                            <%foreach(var c in countries){ %>
                                                <option value="<%=c.COUNTRY_NAME %>"><%=c.COUNTRY_NAME %></option>
                                            <%}%>
                                        </select><span class="maroon">*</span>
                                        <span class="help-inline">
                                            <a href="CountryAdd.aspx">找不到所属的国家请点我</a>
                                        </span>
                                    </div>
                                </div>
                                <div class="form-actions">
                                    <button type="submit" class="btn btn-primary">保存</button>
                                    <a class="btn" href="Javascript:window.history.go(-1)">取消</a>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
<script type="text/javascript">
    $(document).ready(function () {
        $("#belong_Continent").change(function () {
            $("#busyIndicator").show();
            $.post('../Handler/CountryRead.ashx', { belong: $(this).val() }, function (results) {
                if (results) {
                    $("#country_Belong").empty();

                    $.each(results, function (idx, result) {
                        $("#country_Belong").append("<option value='" + result.COUNTRY_NAME + "'>" + result.COUNTRY_NAME + "</option>");
                    });
                    $("#busyIndicator").hide();
                } else {
                    alert(data.Tip);
                    $("#busyIndicator").hide();
                }
            }, 'json');
        });
    });
</script>